import { NgModule } from '@angular/core';
import { BrowserModule } from "@angular/platform-browser";
import { FormsModule } from "@angular/forms";
import { RouterModule, Routes, CanActivate } from "@angular/router";
import { WatchlistMiniModule } from "./../watchlist-mini/watchlist-mini.module";
import { StockPositionModule } from "./stock-position";
import { EntrustBusinessComboModule } from "./entrust-business-combo";
import { UtilsModule } from "utils";
import { VtradeTerminalModule } from './vtrade-terminal/vtradeterminal.module';
import { DetailBasicModule } from './../stock-detail/detail-basic/detail-basic.module';
import { ComboChartModule } from "combo-chart";
import { ModalModule } from "./../modal-module/modal.module";
import { TabListModule } from "tab-list";
import { AuthGuardService, AuthGuardModule } from "auth-guard";
import { SearchModule } from "search";

import { VtradeService } from './vtrade.service';
import { VtradeComponent } from './vtrade.component';
import { VtradeSummaryComponent } from './vtrade-summary/vtradesummary.component';
import { HsClientService } from "./hs-client.service";
import { BusinessTodayModule } from "./business-today";

const vtradeRoutes: Routes = [
  {
    path: "vtrade",
    canActivateChild: [
      AuthGuardService
    ],
    children: [
      {
        path: "",
        pathMatch: "full",
        redirectTo: "000001_SZ"
      },
      {
        path: ":id",
        component: VtradeComponent
      }
    ]
  }];

@NgModule({
  imports: [
    AuthGuardModule,
    BrowserModule,
    FormsModule,
    UtilsModule,
    VtradeTerminalModule,
    WatchlistMiniModule,
    StockPositionModule,
    EntrustBusinessComboModule,
    BusinessTodayModule,
    DetailBasicModule,
    ComboChartModule,
    ModalModule,
    TabListModule,
    SearchModule,
    RouterModule.forChild(vtradeRoutes)
  ],
  exports: [],
  declarations: [
    VtradeComponent,
    VtradeSummaryComponent,
  ],
  providers: [
    VtradeService,
    HsClientService
  ],
})
export class VtradeModule { }
